home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13473 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  907 b 

  1. Path: lrz-muenchen.de!news
  2. From: watzka@stat.uni-muenchen.de (Kurt Watzka)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: I need random number function that returns a number between x and i ?
  5. Date: 7 Apr 1996 08:54:17 GMT
  6. Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
  7. Distribution: world
  8. Message-ID: <4k7vrp$bg@sparcserver.lrz-muenchen.de>
  9. References: <3166C942.2D8@ccis.com>
  10. NNTP-Posting-Host: sun2.lrz-muenchen.de
  11.  
  12. Bill Lund <wlund@ccis.com> writes:
  13.  
  14. >I need random number function that returns a number between x and i ?
  15. >Something like :
  16. >int randomer(int x , int i).
  17.  
  18. >And returns a random number  between x and i.
  19.  
  20. >Please help.
  21.  
  22. The FAQ explains how to get random ints between 0 and n in detail.
  23. The neccesary transformation should be obvious (It's not higher math,
  24. some adding will do nicely)
  25.  
  26. Kurt
  27. --
  28. | Kurt Watzka                             Phone : +49-89-2180-6254
  29. | watzka@stat.uni-muenchen.de
  30.